import java.io.*;
import java.util.*;
import java.net.*;

public class ConnectionWithSocket extends Thread{
	private static ArrayList<String> ulrs;
	private int startIndex;
	private int endIndex;
	private ArrayList<Socket> cons;
	
	public ConnectionWithSocket (ArrayList<String> a, int start, int end){
		ulrs = a;
		startIndex = start;
		endIndex = end;
		cons = new ArrayList<Socket>();
	}
	
	public void run(){
		for (int i = startIndex; i < endIndex; i++){
			try{
				InetAddress addr;
			    Socket sock = new Socket(ulrs.get(i), 80);
			    addr = sock.getInetAddress();
			    
			    sock.close();
			    cons.add(sock);
			} catch (java.io.IOException e) {
				e.printStackTrace();
			}
		}
	}
}
